import Vue from 'vue'
import VueRouter from 'vue-router'
// 1.导入登录注册组件
import Login from '@/views/Login/Login.vue'
import Reg from '@/views/Reg/Reg.vue'
// 导入主页组件
import Main from '@/views/Main/Main.vue'
// 导入 Home 组件
import Home from '@/views/Menus/Home/Home.vue'
import UserInfo from '@/views/Menus/User/UserInfo.vue'
import UserAvatar from '@/views/Menus/User/UserAvatar.vue'
import UserPwd from '@/views/Menus/User/UserPwd.vue'
import ArtCate from '@/views/Menus/Article/ArtCate.vue'
Vue.use(VueRouter)

const routes = [
// 配置路由规则
  { path: '/login', component: Login },
  { path: '/reg', component: Reg },
  {
    path: '/',
    component: Main,
    redirect: '/home',
    children: [
      { path: 'home', component: Home },
      { path: 'user-info', component: UserInfo },
      { path: 'user-avatar', component: UserAvatar },
      { path: 'user-pwd', component: UserPwd },
      { path: 'art-cate', component: ArtCate }

    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
